# 生产者(任务函数)
# 1. 这个函数必须要让celery实例的task装饰器装饰
# 2. 需要celery 自动检测到指定的任务

# 利用celery实现 验证邮件 的异步发送
from django.core.mail import send_mail
from celery_tasks.main import app


@app.task
def celery_send_emails(subject, message, from_email, recipient_list, html_message):
    send_mail(
        subject=subject,
        message=message,
        from_email=from_email,
        recipient_list=recipient_list,
        html_message=html_message,
    )

